﻿<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="~/css/aui.css" />
    <link rel="stylesheet" type="text/css" href="./css/aui.css" />
    <style type="text/css">
        .header {
            padding: 2.5rem 0.5rem 2rem 0.5rem;
        }
    </style>
</head>
<body>
    <header class="aui-bar aui-bar-nav aui-text-left header" id="header">
        <br />
        <h1>
            <a class="aui-btn aui-pull-right" tapmode onclick="openClub()">
                <i class="aui-iconfont aui-icon-mobile"></i>
            </a>
            提交预约
        </h1>
    </header>
    <div class="aui-content aui-margin-b-15">
        @if (ViewData["timeconfirm"].ToString() == "0")
        {
            <ul class="aui-list aui-form-list">
                <li class="aui-list-header">您的预约信息如下</li>
                <li class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-label">
                            <i class="aui-iconfont aui-icon-my"></i>&nbsp;&nbsp;医师姓名
                        </div>
                        <div class="aui-list-item-label">
                            @ViewData["doctorname"]
                        </div>
                    </div>
                </li>
                <li class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-label">
                            <i class="aui-iconfont aui-icon-calendar"></i>&nbsp;&nbsp;预约时间
                        </div>
                        <div class="aui-list-item-label">
                            @ViewData["date"]
                        </div>
                    </div>
                </li>

                <li class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-label">
                            <i class="glyphicon glyphicon-time "></i>&nbsp;&nbsp; 具体时间
                        </div>
                        @switch (ViewData["appointment"].ToString())
                        {
                            case "1":
                                <div class="aui-list-item-label">上午&nbsp;&nbsp;8：00-9：00</div>
                                break;
                            case "2":
                                <div class="aui-list-item-label">上午&nbsp;&nbsp;9：00-10：00</div>
                                break;
                            case "3":
                                <div class="aui-list-item-label">上午&nbsp;&nbsp;10：00-11：00</div>
                                break;
                            case "4":
                                <div class="aui-list-item-label">上午&nbsp;&nbsp;11：00-12：00</div>
                                break;
                            case "5":
                                <div class="aui-list-item-label">下午&nbsp;&nbsp;2：00-3：00</div>
                                break;
                            case "6":
                                <div class="aui-list-item-label">上午&nbsp;&nbsp;3：00-4：00</div>
                                break;
                            case "7":
                                <div class="aui-list-item-label">下午&nbsp;&nbsp;4：00-5：00</div>
                                break;
                        }

                    </div>
                </li>
                @using (Html.BeginForm("Formpost", "Vip", FormMethod.Post))//HttpPost
                {
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                <i class="aui-iconfont aui-icon-cert"></i>&nbsp;&nbsp;患者姓名
                            </div>
                            <div class="aui-list-item-label">
                                <div class="aui-list-item-input">
                                    <input type="text" name="name" placeholder="请输入" pattern="^[\u4e00-\u9fa5]{2,16}$" required oninvalid="setCustomValidity('请填写正确的患者姓名');" oninput="setCustomValidity('');">
                                </div>
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner">
                            <div class="aui-list-item-label">
                                <i class="aui-iconfont aui-icon-cert"></i>&nbsp;&nbsp;患者年龄
                            </div>
                            <div class="aui-list-item-label">
                                <div class="aui-list-item-input">
                                    <input type="text" name="age" placeholder="请输入" pattern="^[0-9]{1,2}$" required oninvalid="setCustomValidity('请输入正确的患者年龄');" oninput="setCustomValidity('');">
                                </div>
                            </div>
                        </div>
                    </li>
                    <li class="aui-list-item">
                        <div class="aui-list-item-inner aui-list-item-center aui-list-item-btn">
                            <input name="id" type="hidden" value="@ViewData["id"]" /><input name="date" type="hidden" value="@ViewData["date"]" /><input name="time" type="hidden" value="@ViewData["appointment"]" />
                            <div><button class="aui-btn aui-btn-info aui-margin-r-5" type="submit" id="submit">提交</button></div>
                            <div class="aui-btn aui-btn-danger aui-margin-l-5"><a href="/Vip/Appointment?id=@ViewData["id"]&doctorname=@ViewData["doctorname"]"><font color="#FFFFFF">取消</font></a></div>
                        </div>
                    </li>
                }


            </ul>
        }
        else
        {
            <script type="text/javascript" src="~/script/aui-dialog.js"></script>
            <script type="text/javascript" src="~/script/api.js"></script>
            <script type="text/javascript">

                    var dialog = new auiDialog({})
                    window.onload = function () {
                        dialog.alert({
                            title: "温馨提示",
                            msg: '您已经有此时段的未取号预约<p>请选择其它时段进行预约</p>',
                            buttons: ['查看我的预约', '重新选择']
                        }, function (ret) {
                            if (ret.buttonIndex == 2) {
                                window.location.href = "/Vip/ba2d0cf27b323a48";
                            }
                            else window.location.href = "/Vip/My"
                            console.log(ret)
                        })
                    }
                
            </script>
        }
    </div>
        
</body>
</html>

<script type="text/javascript" src="./script/api.js"></script>
<script type="text/javascript">
    apiready = function () {
        api.setStatusBarStyle({
            style: 'light'
        });
        api.parseTapmode();
        var header = $api.byId('header');
        var headerPos = $api.offset(header);
        var body_h = $api.offset($api.dom('body')).h;
        var header_h = $api.offset($api.byId('header')).h;
        api.openFrame({
            name: 'index_frm',
            url: './html/index_frm.html',
            bounces: true,
            rect: {
                x: 0,
                y: header_h,
                w: 'auto',
                h: 'auto'
            }
        })
    };
    function openClub() {
        var delay = 0;
        if (api.systemType != 'ios') {
            delay = 300;
        }
        api.openWin({
            name: 'club_win',
            url: './html/club_win.html',
            bounces: false,
            delay: delay,
            slidBackEnabled: true,
            vScrollBarEnabled: false,
            progress: {
                type: "page"
            }
        });
    }
    function closeWin() {
        api.closeWin({
        });
    }
</script>